<!--
 * @Author: sdorein sdorein@163.com
 * @Date: 2024-07-26 15:04:04
 * @LastEditors: sdorein sdorein@163.com
 * @LastEditTime: 2024-07-29 14:52:58
 * @FilePath: \vite-as-editor\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
  </div>
</template>

<script lang="ts">
import { defineComponent, ref ,nextTick,provide } from 'vue';
import { useRoute } from 'vue-router';

export default defineComponent({
  setup() {
    const isRouterAlive = ref(true);
    // 刷新页面
    const reload = () => {
      isRouterAlive.value = false;
      nextTick(() => {
        isRouterAlive.value = true;
      });
    };

    provide('reload', reload);
    return {
      isRouterAlive
    };
  },
});
</script>

<style lang="scss" scoped>
#app {
  position: absolute;
  left: 0;
  top: 0;
}

// 页面切换动画
.fade-enter-active {
  transition: all 1.5s ease;
}
.fade-leave-active {
  transition: all 1.5s ease;
}
.fade-enter {
  transform: translateX(5px);
  opacity: 0;
}
.fade-leave-to {
  transform: translateX(5px);
  opacity: 0;
}
.el-message-box.JSONView {
  width: 1100px;
}

// 提示样式
.Prompt{
  font-size: 12px; color: #969799; margin-bottom: 10px
}
</style>